#!/usr/bin/env bash

set -euo pipefail

command="GITPOD_THEIA_PORT=23000 /ide/bin/code $*"

if [[ "${PWD}" == /workspace* ]]; then
     command="cd ${PWD} && ${command}"
fi

ssh -p 23001 gitpod@10.0.2.2 "${command}"
